﻿<ribbon:RibbonWindow xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"  x:Class="SSRSTestGenerator.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:UserControls="clr-namespace:SSRSTestGenerator.UserControls"
        xmlns:ribbon="clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary"
        xmlns:dxd="http://schemas.devexpress.com/winfx/2008/xaml/docking"
        xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"        
        xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"  
        xmlns:dxnb="http://schemas.devexpress.com/winfx/2008/xaml/navbar"
        xmlns:layout="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
        xmlns:editors="http://schemas.devexpress.com/winfx/2008/xaml/editors"
        Title="Reporting Services Testing Environment"                     
		x:Name="RibbonWindow"
        Loaded="RibbonWindow_Loaded" Closing="RibbonWindow_Closing"
        Icon="/Images/Application.ico"
		Width="640" Height="480" WindowState="Maximized" WindowStyle="ToolWindow">

    <ribbon:RibbonWindow.Resources>

        <Style x:Key="FocusedCellStyle" TargetType="dxg:CellContentPresenter">
                <Style.Triggers>
                    <Trigger Property="dxg:DataViewBase.IsFocusedCell" Value="True">
                        <Setter Property="Background" Value="CornflowerBlue" />
                        <Setter Property="Foreground" Value="White" />
                    </Trigger>
                </Style.Triggers>
            </Style>     

        
    </ribbon:RibbonWindow.Resources>

    <Grid x:Name="LayoutRoot">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="auto"/>
        </Grid.RowDefinitions>

        <ribbon:Ribbon x:Name="Ribbon">
            <ribbon:Ribbon.ApplicationMenu>
                <ribbon:RibbonApplicationMenu SmallImageSource="Images\16x16NewProjectpng.png">
                    
                    <ribbon:RibbonApplicationMenuItem Header="New Project"
                                                      x:Name="mnuItmNewProject"
                                                      Click="btnNewProject_Click"
                                                      ImageSource="Images\32x32NewProject.png"/>
                    <ribbon:RibbonApplicationMenuItem Header="Open Project"
                                                      x:Name="mnuItmOpenProject"
                                                      Click="btnOpenProperties_Click"
                                                      ImageSource="Images\32x32OpenProject.png"/>
                </ribbon:RibbonApplicationMenu>

            </ribbon:Ribbon.ApplicationMenu>
            <ribbon:RibbonTab x:Name="HomeTab" Header="Home" >
                <ribbon:RibbonGroup Header="Project" x:Name="grpProject" >
                    <ribbon:RibbonButton x:Name="btnNewProject" 
                                         LargeImageSource="Images\32x32NewProject.png"
                                         Label="New Project" Click="btnNewProject_Click" IsEnabled="True" />
                    <ribbon:RibbonButton x:Name="btnOpenProperties"
                                         SmallImageSource="Images\16x16Open.png"
                                         Label="Open Project" Click="btnOpenProperties_Click" IsEnabled="True" />
                    <ribbon:RibbonButton x:Name="btnSave"
                                         SmallImageSource="Images\16x16SaveProject.png"
                                         Label="Save Project" Click="btnSave_Click" IsEnabled="False"/>
                    <ribbon:RibbonButton x:Name="btnEditProperties"
                                         SmallImageSource="Images\16x16Edit.png"
                                         Label="Edit Properties" Click="btnEditProperties_Click" IsEnabled="False"/>                              
                </ribbon:RibbonGroup>

                <ribbon:RibbonGroup x:Name="grpClass" Header="Test Class" >
                    <ribbon:RibbonButton x:Name="btnNewClass"
                                         LargeImageSource="Images\32x32NewClass.png"
                                         Label="New Class" Click="btnNewClass_Click" IsEnabled="False" />                   
                    <ribbon:RibbonButton x:Name="btnClassDelete"
                                         SmallImageSource="Images\16x16Delete.png"
                                         Label="Delete Class" IsEnabled="False" Click="btnClassDelete_Click" Visibility="Collapsed"/>                    
                    <ribbon:RibbonButton x:Name="btnClassEditProperties" IsEnabled="False"
                                         SmallImageSource="Images\16x16Edit.png"
                                         Label="Edit Properties" Click="btnClassEditProperties_Click" />
                    <ribbon:RibbonButton x:Name="btnRemoveClassAssertions" IsEnabled="true"
                                         SmallImageSource="Images\16x16Edit.png" Visibility="Collapsed"
                                         Label="Remove Class Assertions" Click="btnRemoveClassAssertions_Click" />
                </ribbon:RibbonGroup>

                <ribbon:RibbonGroup x:Name="grpReport" Header="Report" >                    
                    <ribbon:RibbonButton x:Name="btnReportGerParams"
                                         SmallImageSource="Images\16x16GetParameters.png" IsEnabled="False"
                                         Label="Get Report Parameters" Click="btnReportGerParams_Click" />
                    <ribbon:RibbonButton x:Name="btnSaveParameters"
                                         SmallImageSource="Images\16x16SaveParameters.png"
                                         Label="Save Parameters" Click="btnSaveParameters_Click" IsEnabled="False"/>
                    <ribbon:RibbonButton x:Name="btnReportCallReport"
                                         SmallImageSource="Images\16x16GetReport.png" IsEnabled="False"
                                         Label="Call Report" Click="btnReportCallReport_Click" />
                    <ribbon:RibbonButton x:Name="btnReportCreateTests"
                                         SmallImageSource="Images\16x16GenerateCode.png"
                                         Label="Create Unit Test Code" Click="btnReportCreateTests_Click" IsEnabled="False" />                    
                </ribbon:RibbonGroup>

                <ribbon:RibbonGroup x:Name="grpCode" Header="Code" >
                    <ribbon:RibbonButton x:Name="btnCutPasteCode"
                                         SmallImageSource="Images\16x16CutPaste.png"
                                         Label="Copy Code To Clipboard" Click="btnCutPasteCode_Click" IsEnabled="False" />
                    <ribbon:RibbonButton x:Name="btnPrintCode"
                                         SmallImageSource="Images\16x16Printer.png" Visibility="Visible"
                                         Label="Print Code" Click="btnPrintCode_Click" IsEnabled="False" />
                </ribbon:RibbonGroup>

                <ribbon:RibbonGroup x:Name="grpLoadReport" Header="Misc" >
                    <ribbon:RibbonButton x:Name="btnReportValiadetService"
                                         SmallImageSource="Images\16x16ServiceUrl.png" IsEnabled="False"
                                         Label="Validate Web Service Url" Click="btnReportValiadetService_Click"/>
                    <ribbon:RibbonButton x:Name="btnReportValidateServer" IsEnabled="False"
                                         SmallImageSource="Images\16x16ServerUrl.png"
                                         Label="Validate Report Server Url" Click="btnReportValidateServer_Click" />                    
                </ribbon:RibbonGroup>

                <ribbon:RibbonGroup x:Name="grpHelp" Header="About" >
                    <ribbon:RibbonButton x:Name="btnUserGuide"
                                         LargeImageSource="Images\32x32Help.png"
                                         Label="User Guide" Click="btnUserGuide_Click" />
                    <ribbon:RibbonButton x:Name="btnAbout"
                                         LargeImageSource="Images\32x32About.png"
                                         Label="About" Click="btnAbout_Click"  />
                </ribbon:RibbonGroup>
            </ribbon:RibbonTab>
        </ribbon:Ribbon>

        <Image Name="imgLoadreport" Height="500" Width="500" Source="BoilerPlate.bmp" Visibility="Visible" Grid.Row="1"></Image>
        
        <dxd:DockLayoutManager x:Name="DemoDockContainer" Grid.Row="1" FloatingMode="Desktop" Visibility="Collapsed">
            <dxd:LayoutGroup>
                <dxd:LayoutGroup Orientation="Vertical" Width="3*">
                    <dxd:LayoutGroup Name="group1" Height="3*">
                        <dxd:LayoutPanel Name="projectPanel" Caption="Project Files"  CaptionImage="/SSRSTestGenerator;component/Images/BO_CartItem.png" Width="240" AllowClose="False">
                            <!--<ScrollViewer CanContentScroll="True">-->
                            <dxg:TreeListControl x:Name="projectFilesColumns"  DesignTimeShowSampleData="True" Width="auto" >
                                    <dxg:TreeListControl.Columns>
                                        <dxg:TreeListColumn Name="colName" FieldName="Name" Header="File" ShowInColumnChooser="False" ReadOnly="True" Width="auto" />
                                    </dxg:TreeListControl.Columns>
                                    <dxg:TreeListControl.View>
                                        <dxg:TreeListView x:Name="projectFilesView"  CellStyle="{StaticResource FocusedCellStyle}"  ImageFieldName="Image" ShowNodeImages="True" ShowFocusedRectangle="True" ShowIndicator="True" FocusedRowChanged="projectFilesView_FocusedRowChanged" KeyFieldName="Id" ParentFieldName="Id" AutoWidth="True" AllowColumnFiltering="False"  />
                                    </dxg:TreeListControl.View>
                                </dxg:TreeListControl>
                            <!--</ScrollViewer>-->
                        </dxd:LayoutPanel>
                        
                        <dxd:TabbedGroup Name="tabControls"  Height="auto" SelectedItemChanged="tabControls_SelectedItemChanged">
                            <dxd:LayoutPanel Name="panelReportDetails" Tag="ReportDetails" Caption="Report Details" CaptionImage="/SSRSTestGenerator;component/Images/BO_Note.png" HeaderBarContainerControlName="ErrorsBar" AllowClose="False">
                                <Border Background="White" Margin="3" x:Name="borderLoadReport">                                    
                                    <UserControls:LoadReport x:Name="ctrlLoadReport" Visibility="Collapsed" IsEnabled="true" RibbonBarItemUpdated="UpdateRibbonBar" EditedProject="EditedProject" SavedReportXml="LoadReport_SavedReportXml" VerticalAlignment="Center" HorizontalAlignment="Center" NotifyedUser="UpdateNotifications"></UserControls:LoadReport>                                                                            
                                </Border>
                            </dxd:LayoutPanel>
                            <dxd:LayoutPanel Name="panelAssertionDetails" Tag="BuildAssertions" Caption="Build Assertions" CaptionImage="/SSRSTestGenerator;component/Images/BO_Note.png">
                                <Border Background="White" Margin="3" x:Name="borderBuildAssertions">
                                    <UserControls:BuildAssertions AssertionActioned="ctrlBuildAssertions_AssertionActioned" UpdatedClassPropsWithNodeDetails="ctrlBuildAssertions_UpdatedClassPropsWithNodeDetails" RibbonBarItemUpdated="UpdateRibbonBar" IsEnabled="False" EditedProject="EditedProject" NotifyedUser="UpdateNotifications" CreatedTests="ctrlBuildAssertions_CreatedTests"  x:Name="ctrlBuildAssertions"></UserControls:BuildAssertions>
                                </Border>
                            </dxd:LayoutPanel>
                            <dxd:LayoutPanel Name="panelCodeDetails" Tag="UnitTestCode" Caption="Unit Test Code" CaptionImage="/SSRSTestGenerator;component/Images/Find_16x16.png">
                                <UserControls:GenerateTestCode x:Name="ctrlGenerateTestCode" NotifyedUser="UpdateNotifications" EditedProject="EditedProject" RibbonBarItemUpdated="UpdateRibbonBar" IsEnabled="False"></UserControls:GenerateTestCode>
                            </dxd:LayoutPanel>
                        </dxd:TabbedGroup>
                    </dxd:LayoutGroup>

                    <dxd:TabbedGroup Name="tabNotifications" Height="1*">
                        <dxd:LayoutPanel Name="notificationsPanel" Caption="Notifications" CaptionImage="/SSRSTestGenerator;component/Images/BO_Note.png" HeaderBarContainerControlName="ErrorsBar" AllowClose="False">
                            <Border Background="White" Margin="3" x:Name="notificationList">
                                <ListBox Name="lstBoxNotifications"   ItemsSource="{Binding LstNotifications}" ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollViewer.HorizontalScrollBarVisibility="Auto" Margin="1">
                                    <ListBox.ItemTemplate>
                                        <DataTemplate>
                                            <StackPanel Orientation="Horizontal">
                                                <Image Source="{Binding Path=ImagePath}"/>
                                                <TextBlock Text="{Binding Path=Message}" Margin="5,0,0,0" />
                                            </StackPanel>
                                        </DataTemplate>
                                    </ListBox.ItemTemplate>
                                </ListBox>
                            </Border>
                        </dxd:LayoutPanel>
                    </dxd:TabbedGroup>
                </dxd:LayoutGroup>

                <dxd:TabbedGroup Name="tabbedGroup2" SelectedTabIndex="1" Width="240">
                    <dxd:LayoutPanel Name="PanelProperties" Caption="Properties" CaptionImage="/SSRSTestGenerator;component/Images/BO_Category.png" HeaderBarContainerControlName="SolutionBar" AllowClose="False">
                        <layout:LayoutGroup Orientation="Vertical">
                            <layout:LayoutGroup Header="Test Class Properties" View="GroupBox" Orientation="Vertical">
                                <layout:LayoutGroup Orientation="Vertical">

                                    <layout:LayoutGroup Orientation="Vertical" View="GroupBox" Header="Report Details">
                                        <layout:LayoutItem Label="Report">
                                            <TextBlock Name="txtBlkReportname"  Margin="13,0,0,0" />
                                        </layout:LayoutItem>
                                        <layout:LayoutItem Label="Subfolders">
                                            <TextBlock Name="txtBlkReportPath"/>
                                        </layout:LayoutItem>
                                        <layout:LayoutItem Label="Params.">
                                            <ListBox Name="lstBxReportParameters" MaxHeight="200" Margin="7,0,0,0" Height="auto" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch"/>
                                        </layout:LayoutItem>
                                    </layout:LayoutGroup>

                                    <layout:LayoutGroup Orientation="Vertical" View="GroupBox" Header="Report Credentials">
                                        <layout:LayoutItem Label="Username">
                                            <TextBlock Name="credentialsUsername" />
                                        </layout:LayoutItem>
                                        <layout:LayoutItem Label="Password">
                                            <TextBlock Name="credentialsPassword" Margin="3,0,0,0"/>
                                        </layout:LayoutItem>
                                        <layout:LayoutItem Label="Domain">
                                            <TextBlock Name="credentialsDomain" Margin="11,0,0,0" />
                                        </layout:LayoutItem>
                                    </layout:LayoutGroup>
                                    <layout:LayoutItem Label="Tests In Class:">
                                        <TextBlock Name="classTestCount" />
                                    </layout:LayoutItem>
                                </layout:LayoutGroup>
                            </layout:LayoutGroup>

                            <layout:LayoutGroup Header="Project Properties" View="GroupBox" Orientation="Vertical">
                                <layout:LayoutGroup Orientation="Vertical" View="GroupBox" Header="Report Server Details">
                                    <layout:LayoutItem Label="Server">
                                        <TextBlock Name="serviceUrl" Margin="3,0,0,0"  TextWrapping="Wrap"/>
                                    </layout:LayoutItem>
                                    <layout:LayoutItem Label="Service">
                                        <TextBlock Name="reportServerUrl"  TextWrapping="Wrap"/>
                                    </layout:LayoutItem>
                                </layout:LayoutGroup>

                                <layout:LayoutGroup Orientation="Vertical" View="GroupBox" Header="Project Details">
                                    <layout:LayoutItem Label="Saved Path">
                                        <TextBlock Name="txtblkSavedPath" TextWrapping="Wrap" TextAlignment="Right"/>
                                    </layout:LayoutItem>
                                    <layout:LayoutItem Label="# Overall Tests">
                                        <TextBlock Name="NumberOfTests" TextAlignment="Right" />
                                    </layout:LayoutItem>
                                    <layout:LayoutItem Label="Created">
                                        <TextBlock Name="txtblkCreated"  TextAlignment="Right"/>
                                    </layout:LayoutItem>

                                    <layout:LayoutItem Label="Test Framework">
                                        <WrapPanel>
                                            <editors:CheckEdit Name="chkBxVSTest"  IsTabStop="False" IsHitTestVisible="False" Content="MSTest" />
                                            <editors:CheckEdit Name="chkBxNUnitTest"  Margin="3" IsTabStop="False" IsHitTestVisible="False" Content="NUnit"/>
                                        </WrapPanel>
                                    </layout:LayoutItem>

                                    <layout:LayoutItem Label="Language">
                                        <WrapPanel>
                                            <editors:CheckEdit Name="languageCSharp" Margin="31,0,0,0"  IsTabStop="False" IsHitTestVisible="False" Content="C#" />
                                            <editors:CheckEdit Name="languageVB"  Margin="22,0,0,0" IsTabStop="False" IsHitTestVisible="False" Content="VB.Net"/>
                                        </WrapPanel>
                                    </layout:LayoutItem>
                                </layout:LayoutGroup>

                            </layout:LayoutGroup>
                        </layout:LayoutGroup>
                    </dxd:LayoutPanel>
                </dxd:TabbedGroup>
            </dxd:LayoutGroup>
        </dxd:DockLayoutManager>

        <StatusBar Name="statusBar" Grid.Row="2">
            <StatusBar.ItemsPanel>
                <ItemsPanelTemplate>
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                    </Grid>
                </ItemsPanelTemplate>
            </StatusBar.ItemsPanel>

            <StatusBarItem Name="statusItem" Grid.Column="2" Height="auto" HorizontalContentAlignment="Stretch">
                <TextBlock Name="statusText" HorizontalAlignment="Center" FontWeight="Bold" Foreground="Red" FontSize="15" Height="auto"/>
                <!--<ProgressBar Name="mainPrgBar" Minimum="0" Maximum="100" Height="15"/>-->
            </StatusBarItem>           
        </StatusBar>

    </Grid>
</ribbon:RibbonWindow>
